

<template>
  <div class="detail">
    
            <div class="formd">
                <div>
                    <div>
                           <span on>*</span> 医生
                    </div>
                    <div>
                          <dialogTableUser v-if="!this.that.paramsSave.id" :thatF="this" :dialogParams="dialogParams" ></dialogTableUser>

                        
                          <el-input  v-else v-model="that.paramsSave.real_name" disabled ></el-input>
                    </div>
                   
                </div>
               
                 <div>
                    <div>
                        <span on>*</span>出诊开始时间
                    </div>
                    <div>
                      

                            <el-time-picker
                              value-format="HH-mm"
                                v-model="that.paramsSave.start_time"
                                placeholder="任意开始时间">
                            </el-time-picker>
                   
                    </div>
                </div>
                <div>
                    <div>
                         <span on>*</span>出诊结束时间
                    </div> 
                    <div>
                        

                           <el-time-picker
                             value-format="HH-mm"
                                v-model="that.paramsSave.end_time"
                                placeholder="任意结束时间">
                            </el-time-picker>
                    </div>
                </div>
                 <div>
                    <div>
                          排班时间
                    </div>
                    <div>
                          <el-select
                                    v-model="that.paramsSave.week"
                                    multiple
                                    filterable
                                    allow-create
                                    default-first-option
                                    placeholder="请选择排班时间">
                                    <el-option
                                    v-for="item in $baseBai['doctorScheduling']['week']"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value">
                                    </el-option>
                                </el-select>
                    </div>
                </div>
            </div>
            <div class="buts">
                 <div> <el-button type="info" @click="that.Detail_Show=false">取消</el-button></div>
                 <div> <el-button type="success" @click="save" >保存</el-button></div>
            </div>
   
     
  </div>
</template>
<script>
let t;
import dialogTableUser from '@/components/dialogTableUser'
import { mapState, mapActions } from "vuex";
export default {
  data() {
    return {
     
        options:[
            
        ],
  
        dialogParams:{
            placeholder:'请选择医师',
            userinfo:{
                name:'',
                id:'',
            },
            d:{
                user_type:2,
            },
        },
    };
  },
components: {
   dialogTableUser
  },
  props:['dialogTitle','that'],
  mounted(){
      
     this.dialogParams.userinfo.id=this.that.paramsSave.user_id;
     this.dialogParams.userinfo.name=this.that.paramsSave.real_name
  },
  methods: {
      save(){
          console.log("this.that.paramsSave",this.that.paramsSave)

        
          this.that.paramsSave.user_id=this.dialogParams.userinfo.id;
          this.that.addSave()
      },
  },
  computed: {
      
    ...mapState({
        	
      doctorInfo: state =>{
          return  state.doctorInfo.doctorInfo.map(v=>{
              return {
                  ...v,
                  value: v.user_id,
                  label: v.doctor.real_name
              }
          })
      },
    
    }),
  },
};
</script>
<style lang='scss' scoped>
.addUdetailpdate {
  padding: 0 5%;
}
/deep/ .el-dialog__body {
  height: 70vh;
  overflow: scroll;
}
/deep/ .formd{
    >div{
        display: flex;
        align-items: center;
        margin:0 50px;
        margin-bottom: 20px;
        >div:nth-child(1){
            width: 100px;
        }
        input{
            width: 200px !important;
        }
    }
}
.buts{
    display: flex;
    justify-content: center;
    >div{
        margin-right: 20px;
    }
}
[on]{
    color: red;
}
</style>